﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Data.SqlClient;
using System.Linq;
using System.Linq.Expressions;
using Icms.Core.Repository;
using Omu.ValueInjecter;

namespace Icms.Data
{
    public class Repo2<T> : IRepo2<T> where T : class
    {
        private readonly DbContext c;
        
        public Repo2(IDb2ContextFactory contextFactory)
        {
            c = contextFactory.GetContext();
        }

        public IEnumerable<T> Where(Expression<Func<T, bool>> predicate)
        {
            return c.Set<T>().Where(predicate);
        }

        public IEnumerable<T> GetAll()
        {
            return c.Set<T>();
        }

       

    }
}